const notFound = r => require.ensure([], () => r(require('../views/404.vue')), 'notFound')
const dlogin = r => require.ensure([], () => r(require('../views/pageTransfer.vue')), 'dLogin')
const logging = r => require.ensure([], () => r(require('../views/pageTransfer.vue')), 'logging')
const sm2login = r => require.ensure([], () => r(require('../views/pageTransfer.vue')), 'sm2login')
const login = r => require.ensure([], () => r(require('../views/login/Login.vue')), 'login')
const layout = r => require.ensure([], () => r(require('../layout/index.vue')), 'layout')
const home = r => require.ensure([], () => r(require('../views/Home.vue')), 'home')
const demoPatList = r => require.ensure([], () => r(require('../views/domeList.vue')), 'domeList')
const demoApplyHIS = r => require.ensure([], () => r(require('../views/domeApplyHIS.vue')), 'demoApplyHIS')
const cancelApplyHIS = r => require.ensure([], () => r(require('../views/cancelApplyHIS.vue')), 'cancelApplyHIS')
const sysdesc = r => require.ensure([], () => r(require('../views/sysdescription.vue')), 'sysdesc')
const resetpassword = r => require.ensure([], () => r(require('../views/Resetpassword.vue')), 'resetpassword')
// const claimpassword = r => require.ensure([], () => r(require('../views/login/ClaimPwd.vue')), 'claimpassword')
// const register = r => require.ensure([], () => r(require('../views/login/Register.vue')), 'print')

let routes = [
  { path: '*', redirect: { path: '/404' }, name: '404', hidden: true },
  { path: '/login', component: login, name: '登录', hidden: true },
  { path: '/dlogin', component: dlogin, name: '登录', hidden: true },
  { path: '/logging', component: logging, name: '登录中', hidden: true },
  { path: '/sm2login', component: sm2login, name: '福鼎市医院单点登录', hidden: true },
  { path: '/404', component: notFound, name: '404', hidden: true },
  { path: '/domePatList', redirect: { path: '/demoPatList' }, name: '患者列表', hidden: true },
  { path: '/demoPatList', component: demoPatList, name: '患者列表', hidden: true },
  { path: '/applyHIS', component: demoApplyHIS, name: 'HIS申请', hidden: true },
  { path: '/cancelApplyHIS', component: cancelApplyHIS, name: '取消HIS申请', hidden: true },
  // { path: '/register', component: register, name: '注册', hidden: true },
  // { path: '/resetpwd', component: resetpassword, name: '修改密码', hidden: true },
  // { path: '/claim', component: claimpassword, name: '找回密码', hidden: true },
  {
    path: '/',
    component: layout,
    name: '主页',
    hidden: true,
    redirect: '/home',
    children: [
      { path: 'home', component: home, name: '首页', hidden: true, meta: { title: '首页' }},
      { path: 'sysdesc', component: sysdesc, name: '系统说明', hidden: true, meta: { title: '系统说明' }},
      { path: 'password', component: resetpassword, name: '修改密码', hidden: true, meta: { title: '修改密码' }}
    ]
  }
]

export default routes
